import request from '@/utils/request'

/**
 * 获取流程列表
 * @param param
 */
export function getFlowDataList(param){
	return request({
		url: '/api/v1/flow/page',
		method: 'get',
		params: param
	})
}

/**
 * 获取流程详情
 * @param param
 */
export function getFlowDataInfo(id){
	return request({
		url: `/api/v1/flow/${id}/form`,
		method: 'get',
	})
}

/**
 * 新建流程
 * @param param
 */
export function addFlow(data){
	return request({
		url: `/api/v1/flow/create`,
		method: 'post',
		data: data
	})
}

/**
 * 修改流程
 * @param param
 */
export function editFlow(id,data){
	return request({
		url: `/api/v1/flow/` + id,
		method: 'put',
		data: data
	})
}

/**
 * 删除流程
 * @param param
 */
export function deleteFlow(ids){
	return request({
		url: `/api/v1/flow/` + ids,
		method: 'delete',
	})
}

/**
 * 流程步骤详情
 * @param param
 */
export function getFlowEngine(id){
	return request({
		url: `/api/v1/flow/` + id,
		method: 'get',
	})
}

/**
 * 提交流程步骤
 * @param param
 */
export function submitFlowEngine(id, data){
	return request({
		url: `/api/v1/flow/flowEngineAdd/` + id,
		method: 'post',
		data: data,
	})
}
